<?php
require('jsonencode.php');
require('OModel.php');
$link = DBOpen();
$db_selected = mysql_select_db("calcwb",$link);
$sql = "SELECT * FROM category ";
$result = mysql_query($sql) or die(mysql_error());
$i=0; 
while($row = mysql_fetch_array($result,MYSQL_ASSOC)) 
{ 
        $responce->rows[$i]['id']=$row['CategoryID']; 
        $responce->rows[$i]['cell']=array(
                $row['CategoryID'], 
                $row['Name'],
                $row['Comment']); 
        $i++; 
} 
mysql_close($link);
echo json_encode($responce);
?>
